package com.msoe.client.panels.eventhandlers;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Widget;
import com.msoe.client.panels.PanelMap;
import com.msoe.client.panels.UserHome;

public class UserHomeEventHandler implements ClickListener{
	
	private UserHome home;
	
	public UserHomeEventHandler(UserHome userhome){
		home = userhome;		
	}
	
	public void onClick(Widget sender){

		if(sender instanceof Button){
			Button clickedButton = ((Button) sender);
			if(clickedButton.getText().equals("Add Ride")){
				PanelMap.showPanel(home, PanelMap.getPanel("AddRide"));
			}else if(clickedButton.getText().equals("Get Ride")){
				PanelMap.showPanel(home, PanelMap.getPanel("GetRide"));
			}
		}
	}

}
